/*
 * @Author: Jim <jimjiang0909@gmail.com>
 * @Create time:   2016-09-06 10:02:14
 * @Last Modified by:   Jim
 * @Last Modified time: 2016-09-06 10:03:41
 * @File Name: myProfileInfo.js
 */

define(function(require, exports, module) {

    var tpl = require('{base}/tpls/myProfileEditInfoNav.tpl');

    var myProfileEditINfoNav = {

        template: _.template(tpl),

        render: function(page, obj) {
            this.page = page;
            return this.template();
        },

        componentMount: function() {
            this.bindEvt();
        },

        bindEvt: function() {
            var tthis = this,
                dom = $('#' + this.page.id);
            dom.find('.myProfileEditInfoNav').find('.edit').on('click', function() {
                console.log($(this).parent().text());
                var type = $(this).attr('anchorType');
                if (type) {
                    tthis.affectOtherChange('anchor', type);
                }
            });
        },

        componentUpdate: function() {

        },

        affectOtherChange: function(typeString, val) {
            if (this.page.myProfileEditInfoNavComponentChange) {
                this.page.myProfileEditInfoNavComponentChange(typeString, val);
            }
        },
    }

    module.exports = myProfileEditINfoNav;
});
